package cn.hongxin.sap.conn.client;

import cn.getech.poros.framework.common.api.RestResponse;
import cn.hongxin.sap.conn.dto.ErpFunctionParamDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@FeignClient(
        name = "sap-interface",
        path = "/api/sap-interface/sap"
)
@Validated
public interface SapClient {

    @GetMapping(value = "/testConnect")
    RestResponse testConnect(@RequestParam String connectMap);

    @GetMapping({"/getSapParamInfo"})
    RestResponse getSapParamInfo(@RequestParam(name = "functionName",required = true) String functionName);

    @RequestMapping(value = "/initFunction",method = RequestMethod.POST)
    RestResponse initFunction(@RequestParam String functionName, @RequestParam String paramJsonStr);

    @RequestMapping(value = "/callSapInterface",method = RequestMethod.POST)
    RestResponse callSapInterface(@RequestParam String functionName, @RequestParam String paramJsonStr);

    @RequestMapping(value = "/v1/callSapInterface",method = RequestMethod.POST)
    RestResponse invokingSapInterface(@RequestBody ErpFunctionParamDTO erpFunctionParamDTO);

    @RequestMapping(value = "/retryCallSapInterface",method = RequestMethod.POST)
    RestResponse retryCallSapInterface(@RequestParam String functionName, @RequestParam String paramJsonStr,@RequestParam String prodQueueId);
}
